<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function findByItem(pg) {
            $("pageN0").value = pg;
            $("f1").submit();
        }

        function $(id) {
            return document.getElementById(id);
        }

    </script>
</head>
<body>
<table border="1" width="60%">
    <thead>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>职位</th>
        <th>工资</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="em:${ipage.records}">
        <td th:text="${em.id}"></td>
        <td th:text="${em.name}"></td>
        <td th:text="${em.position}"></td>
        <td th:text="${em.money}"></td>
        <td><a th:href="@{/employee/findById(id=${em.id})}">修改</a>
            <a th:href="@{/employee/del(id=${em.id})}">删除</a>
        </td>
    </tr>
    </tbody>
</table>

<div>
    <a th:each="i:${#numbers.sequence(1,ipage.pages)}" th:text="${i}"
       style="margin-left: 10px"
       th:href="'javascript:findByItem('+${i}+')'"></a>

    <a href="/add.html">添加</a>
</div>

<form id="f1" action="/employee/findByItem">
    <input type="hidden" name="pageNO" id="pageN0"><br>
    最低工资: <input type="text" name="startMoney" th:value="${startMoney}"><br>
    最高工资: <input type="text" name="endMoney" th:value="${endMoney}"><br>
    职位: <input type="text" name="position" th:value="${position}"><br>
    <input type="submit" value="提 交">
</form>

</body>
</html>